# -*- coding: utf-8 -*-
ALL_DEVICE_INSTANCES={}

def set_device(identifier,instance):
    ALL_DEVICE_INSTANCES[identifier] = instance

def get_device(identifier):
    if identifier in ALL_DEVICE_INSTANCES and ALL_DEVICE_INSTANCES[identifier]:
        return ALL_DEVICE_INSTANCES[identifier]
    return None

def del_device(identifier):
    del ALL_DEVICE_INSTANCES[identifier]
    ALL_DEVICE_INSTANCES[identifier] = None

